<template>
<panel title="昨日支付方式统计">
    <div class="failure-statistic">
    <div class="total"></div>
    <pie :width="chartWidth" :height="chartHeight" :options="options" v-if="show"></pie>
    </div>
</panel>
</template>
<script>
export default {
  name: 'paymentChart',
  props: {
    options: {
      default () {
        return [
        ]
      }
    },
    data: {
      default () {
        return []
      }
    }
  },
  data () {
    return {
      chartWidth: '100px',
      chartHeight: '100px',
      tagName: '',
      show: false
    }
  },

  computed: {
    trendOptions () {
      return {
        tooltip: {
          trigger: 'axis'
        },
        series: [
          {
            data: this.data,
            center: ['50%', '20%']
          }
        ],
        color: ['#c33a31', '#5f9fa8', '#d58364']
      }
    }
  },

  mounted () {
    setTimeout(this.initialize, 400)
  },

  methods: {
    initialize () {
      this.chartWidth = `${this.$el.clientWidth - 40}px`
      this.chartHeight = `${this.$el.clientHeight - 31}px`
      this.show = true
    }
  }
}
</script>